package com.ordertracker.dao;

import com.ordertracker.persistent.dictionary.IOrganization;
import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Description of class.
 * Created 11/19/12 4:24 PM
 *
 * @author andrey.rodin@playtech.com
 */


public class DAO {

    private SessionFactory sessionFactory;

    @Resource
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    public String getHello() {
        return "Hello world";
    }

    @Transactional
    public void save(IOrganization organization) {
//        AuditEntity auditEntity = new AuditEntity();
//        auditEntity.setCreatedByUser(new User());
//        auditEntity.setCreatedDate(new DateTime(System.currentTimeMillis()));
//
//        organization.setAuditField(auditEntity);
//        sessionFactory.getCurrentSession().save(organization);
//        session.beginTransaction();
//        session.save(test);
//        session.getTransaction().commit();
    }

 }
